package com.powernode.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.powernode.constant.StoreConstants;
import com.powernode.domain.Area;
import com.powernode.mapper.AreaMapper;
import com.powernode.service.AreaService;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
* @author 贺
* @description 针对表【area】的数据库操作Service实现
* @createDate 2024-07-19 13:40:40
*/
@Service
@CacheConfig(cacheNames = "com.powernode.service.impl.AreaServiceImpl")
public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area>
    implements AreaService{

    @Resource
    private AreaMapper areaMapper;

    /**
     * 查询所有区域
     *
     * @return
     */
    @Override
    @Cacheable(key = StoreConstants.ALL_AREA_LIST_KEY)
    public List<Area> queryAllAreaList() {
        return areaMapper.selectList(null);
    }


}




